/**
 * Alipay.com Inc.
 * Copyright (c) 2004-2011 All Rights Reserved.
 */
package com.alipay.supergw.common.dal.share_supergw.manual.ibatis;

import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.alipay.supergw.common.dal.share_supergw.manual.daointerface.TransactionUniqueDAO;
import com.alipay.supergw.common.dal.share_supergw.manual.dataobject.TransactionUniqueDO;

/**
 * An ibatis based implementation of dao interface <tt>com.alipay.supergw.common.dal.share_supergw.auto.daointerface.TransactionUniqueDAO</tt>.
 *
 * This file is generated by <tt>supergw-dalgen</tt>, a DAL (Data Access Layer)
 * code generation utility specially developed for <tt>supergw</tt> project.
 * 
 * PLEASE DO NOT MODIFY THIS FILE MANUALLY, or else your modification may
 * be OVERWRITTEN by someone else. To modify the file, you should go to 
 * directory <tt>(project-home)/dalgen</tt>, and 
 * find the corresponding configuration file (<tt>tables/sgw_transaction_unique.xml</tt>). 
 * Modify the configuration file according to your needs, then run <tt>supergw-dalgen</tt> 
 * to generate this file.
 */
public class IbatisTransactionUniqueDAO extends SqlMapClientDaoSupport implements
                                                                      TransactionUniqueDAO {

    /**
     *  Insert one <tt>TransactionUniqueDO</tt> object to DB table <tt>sgw_transaction_unique</tt>, return primary key
     *
     *  <p>
     *  Description for this operation is<br>
     *  <tt></tt>
     *  <p>
     *  The sql statement for this operation is <br>
     *  <tt>insert into sgw_transaction_unique(trans_type_id,out_order_no,gmt_create) values (?, ?, sysdate)</tt>
     *
     *	@param transactionUnique
     *	@return String
     *	@throws DataAccessException
     */
    public String insert(TransactionUniqueDO transactionUnique) throws DataAccessException {
        if (transactionUnique == null) {
            throw new IllegalArgumentException("Can't insert a null data object into db.");
        }

        getSqlMapClientTemplate().insert("MS-TRANSACTION-UNIQUE-INSERT", transactionUnique);

        return transactionUnique.getTransTypeId();
    }

}